/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package suministros.ejb30.entity;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 *
 * @author Diana
 */
@Entity
@Table(name = "alertas")
@NamedQueries({
    @NamedQuery(name = "Alertas.findAll", query = "SELECT a FROM Alertas a"),
    @NamedQuery(name = "Alertas.findByIdAlerta", query = "SELECT a FROM Alertas a WHERE a.idAlerta = :idAlerta"),
    @NamedQuery(name = "Alertas.findByDescAdicional", query = "SELECT a FROM Alertas a WHERE a.descAdicional = :descAdicional"),
    @NamedQuery(name = "Alertas.findByFecha", query = "SELECT a FROM Alertas a WHERE a.fecha = :fecha"),
    @NamedQuery(name = "Alertas.findByAlta", query = "SELECT a FROM Alertas a WHERE a.alta = :alta"),
    @NamedQuery(name = "Alertas.findByTabla", query = "SELECT a FROM Alertas a WHERE a.tabla = :tabla"),
    @NamedQuery(name = "Alertas.findByPkTabla", query = "SELECT a FROM Alertas a WHERE a.pkTabla = :pkTabla"),
    @NamedQuery(name = "Alertas.findByCantidad", query = "SELECT a FROM Alertas a WHERE a.cantidad = :cantidad")})
public class Alertas implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "id_alerta")
    @GeneratedValue(strategy=GenerationType.IDENTITY)
    private Long idAlerta;
    
    @Column(name = "desc_adicional")
    private String descAdicional;
    @Column(name = "fecha")
    @Temporal(TemporalType.TIMESTAMP)
    private Date fecha;
    @Column(name = "alta")
    private Boolean alta;
    @Column(name = "tabla")
    private String tabla;
    @Column(name = "pk_tabla")
    private String pkTabla;
    @Column(name = "cantidad")
    private BigDecimal cantidad;
    @JoinColumn(name = "id_tabla_tipo", referencedColumnName = "id_tabla_tipo")
    @ManyToOne
    private Tipo idTablaTipo;
    @JoinColumn(name = "id_empresa", referencedColumnName = "id_empresa")
    @ManyToOne(optional = false)
    private Empresa empresa;
    @Column(name = "id_zona")
    private String id_zona;
    @Column(name = "id_sistema")
    private Integer id_sistema;

   


    public Alertas() {
    }

    public Alertas(Long idAlerta) {
        this.idAlerta = idAlerta;
    }

    public Integer getId_sistema() {
        return id_sistema;
    }

    public void setId_sistema(Integer id_sistema) {
        this.id_sistema = id_sistema;
    }

    public String getId_zona() {
        return id_zona;
    }

    public void setId_zona(String id_zona) {
        this.id_zona = id_zona;
    }

    public Empresa getEmpresa() {
        return empresa;
    }

    public void setEmpresa(Empresa empresa) {
        this.empresa = empresa;
    }

    public BigDecimal getCantidad() {
        return cantidad;
    }

    public void setCantidad(BigDecimal cantidad) {
        this.cantidad = cantidad;
    }

    public Long getIdAlerta() {
        return idAlerta;
    }

    public void setIdAlerta(Long idAlerta) {
        this.idAlerta = idAlerta;
    }

    public String getDescAdicional() {
        return descAdicional;
    }

    public void setDescAdicional(String descAdicional) {
        this.descAdicional = descAdicional;
    }

    public Date getFecha() {
        return fecha;
    }

    public void setFecha(Date fecha) {
        this.fecha = fecha;
    }

    public Boolean getAlta() {
        return alta;
    }

    public void setAlta(Boolean alta) {
        this.alta = alta;
    }

    public String getTabla() {
        return tabla;
    }

    public void setTabla(String tabla) {
        this.tabla = tabla;
    }

    public String getPkTabla() {
        return pkTabla;
    }

    public void setPkTabla(String pkTabla) {
        this.pkTabla = pkTabla;
    }

    public Tipo getIdTablaTipo() {
        return idTablaTipo;
    }

    public void setIdTablaTipo(Tipo idTablaTipo) {
        this.idTablaTipo = idTablaTipo;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idAlerta != null ? idAlerta.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {

        if (!(object instanceof Alertas)) {
            return false;
        }
        Alertas other = (Alertas) object;
        if ((this.idAlerta == null && other.idAlerta != null) || (this.idAlerta != null && !this.idAlerta.equals(other.idAlerta))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "suministros.ejb30.entity.Alertas[idAlerta=" + idAlerta + "]";
    }

}
